import { createRouter, createWebHistory } from 'vue-router';
import { routes } from './routes';
const router = createRouter({
  history: createWebHistory(),
  scrollBehavior(_to, _from, savedPosition) {
    if (savedPosition) {
      return savedPosition;
    } else {
      return { top: 0 };
    }
  },
  routes,
});
// 全局前置守卫

export default router;
